#version 330 core

in vec2 TexCoords;

uniform float Time;
uniform float Speed;
uniform sampler2D image;
uniform sampler2D imageNoise;

out vec4 FragColor;

void main()
{
	vec3 imgNoiseColor = texture2D(imageNoise, vec2(TexCoords.x, TexCoords.y)).rgb;
	
	vec4 color = texture2D(image, TexCoords);
	color.a = smoothstep(imgNoiseColor.g, imgNoiseColor.g + 0.1, abs(sin(Time*Speed)));
    
    FragColor = color;
}
